/**
 * Created by gongxun on 17/3/7.
 */

var MjCardPlace = function(){
    var that = {};

    //扣牌大小
    that.kouSelectBoxSize = cc.size(0, 0);

    //手牌大小
    that.inhandCardSize = cc.size(109, 168);

    ///自己的
    //手牌缩放
    that.inhandCardScale = 1;

    //开口牌缩放
    that.openCardScale = 1;

    //手牌两边间隔
    that.inhandCardJiange = 30;

    //手牌间隔
    that.inhandCardOffset = 1;

    ///对家的
    //对家缩放
    that.oppoInhandCardScale = 1;

    //对家开口牌缩放
    that.oppoOpenCardScale = 1;

    //手牌间隔
    that.oppoInhandCardOffset = 1;

    ///其他玩家的
    //其他玩家手牌大小
    that.leftInhandCardSize = cc.size(84, 109);

    //其他玩家开口牌大小
    that.leftOpenCardSize = cc.size(134, 126);

    //其他玩家手牌缩放
    that.leftInhandCardScale = 1;

    //其他玩家翻开手牌缩放
    that.leftInhandShowCardScale = 1;

    //其他玩家开口牌缩放
    that.leftOpenCardScale = 1;

    //其他玩家出牌区域
    that.leftInhandRect = cc.rect(0, 0, 0, 0);

    //其他玩家手牌间隔
    that.leftInhandCardOffset = 0;

    //其他玩家最后一张手牌间隔
    that.leftInhandCardOffsetLast = 15;

    //打出牌大小
    that.dealScale = 1;
    that.leftDealScale = 1;

    //初始化
    that.init = function(){
        //手牌缩放
        var width = mo.gameSize.x - that.inhandCardJiange * 2 - that.inhandCardOffset * 13;
        var oneWidth = width / 14;
        that.inhandCardScale = oneWidth / that.inhandCardSize.width;
        that.openCardScale = that.inhandCardScale - 0.1;

        that.oppoInhandCardScale = that.inhandCardScale / 2;
        that.oppoOpenCardScale = that.oppoInhandCardScale - 0.05;


        //扣牌大小
        var cardSize = that.inhandCardSize;
        that.kouSelectBoxSize = cc.size((cardSize.width * that.inhandCardScale + that.inhandCardOffset) * 3, cardSize.height * that.inhandCardScale);

        //其他玩家手牌缩放
        that.leftInhandRect = cc.rect(125, 160, 0, 465);
        oneWidth = (that.leftInhandRect.height - that.leftInhandCardOffset * 13 - that.leftInhandCardOffsetLast) / 14;
        that.leftInhandCardScale = oneWidth / that.leftInhandCardSize.height;
        that.leftInhandShowCardScale = 43 / that.leftOpenCardSize.width;
        that.leftOpenCardScale = 36 / that.leftOpenCardSize.width;

        //打出牌大小
        that.dealScale = 44 / that.inhandCardSize.width;
        that.leftDealScale = 50 / that.leftOpenCardSize.width;
    };

    return that;
};